/*
 * @Author: szx
 * @Date: 2022-05-13 15:13:25
 * @LastEditTime: 2022-05-13 15:14:57
 * @Description:
 * @FilePath: \leetcode\面试题\02\04\04.js
 */
/**
 * @param {ListNode} head
 * @param {number} x
 * @return {ListNode}
 */
var partition = function (head, x) {
    let cur = head,
        next = head;
    while (next) {
        if (next.val < x) {
            cur.val = next.val;
            cur = cur.next;
        }
        next = next.next;
    }
    return head;
};
